package com.yutian.springboot.jdbctemplate.biz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.jdbc.metadata.DataSourcePoolMetadataProvider;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.List;
import java.util.Map;

/**
 * @author zhoulei7
 * @create 2020-09-28
 **/
@Deprecated
@Component
public class DataSourceMeta {

    @Autowired
    private DataSourcePoolMetadataProvider hikariPoolDataSourceMetadataProvider;

    @Autowired
    private DataSource dataSource;


    public String getValidationQuery() {
        return hikariPoolDataSourceMetadataProvider.getDataSourcePoolMetadata(dataSource).getValidationQuery();
    }
}
